<template>
  <el-dialog title="提示！" :visible.sync="dialogVisible" width="450px">
    <div class="dataBox">
      是否需要<span class="span1">立即执行</span>本次修改的内容
    </div>
    <p class="tips">*若不立刻执行，系统将于下次满足条件时自动执行</p>
    <span slot="footer" class="dialog-footer">
      <el-button class="span5" @click="dataFormSubmit(false)">否</el-button>
      <el-button class="span4" @click="dataFormSubmit(true)"
        >是，立刻执行</el-button
      >
    </span>
  </el-dialog>
</template>

<script>
import moment from "moment";
export default {
  data() {
    return {
      refKey: "",
      dialogVisible: false,
    };
  },
  methods: {
    open({ refKey }) {
      this.dialogVisible = true;
      this.refKey = refKey;
    },
    dataFormSubmit(confirm) {
      this.dialogVisible = false;
      if (confirm) {
        this.$parent.$refs[this.refKey].dataFormSubmit(1, () => {
          this.$parent.$refs[this.refKey].dialogVisible = false;
        });
      } else {
        this.$parent.$refs[this.refKey].dataFormSubmit(0, () => {
          this.$parent.$refs[this.refKey].dialogVisible = false;
        });
      }
    },
  },
};
</script>
<style lang="scss" scoped>
.dataBox {
  font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
  font-weight: 400;
  font-size: 18px;
  color: #333333;
  padding: 0 40px;
  box-sizing: border-box;
  text-indent: 20px;
  line-height: 30px;
  .span1 {
    color: #1890ff;
  }
  .span2 {
    color: #a2170b;
  }
}

.tips {
  font-size: 14px;
  color: rgba(144, 140, 140, 0.8);
  margin-top: 25px;
  text-align: center;
}
::v-deep .span3 {
  background: #a2170b !important;
  border-radius: 10px 10px 10px 10px;
}
::v-deep .span4 {
  background: #1890ff !important;
  border-radius: 10px 10px 10px 10px;
}
.el-button {
  color: #fff;
}
.span5 {
  width: 80px;
  background: rgba(144, 140, 140, 0.8);
  border-radius: 10px 10px 10px 10px;
}
</style>
